Style Primitives
MGLFeature
@protocol MGLFeature <MGLAnnotation>
                        The MGLFeature protocol is used to provide details about geographic features
                        contained in an MGLShapeSource or
                        MGLVectorTileSource object. Each
                        concrete
                        subclass of MGLShape in turn has a subclass
                        that conforms to this protocol. A
                        feature object associates a shape with an optional identifier and attributes.
You can add custom data to display on the map by creating feature objects and
                        adding them to an MGLShapeSource using
                        the
                        -[MGLShapeSource initWithIdentifier:shape:options:]
                        method or
                        MGLShapeSource.shape
                        property.
                      
In addition to adding data to the map, you can also extract data from the map:
                        -[MGLMapView visibleFeaturesAtPoint:]
                        and related methods return feature
                        objects that correspond to features in the source. This enables you to inspect
                        the properties of features in vector tiles loaded by
                        MGLVectorTileSource
                        objects. You also reuse these feature objects as overlay annotations.
                      
While it is possible to add MGLFeature-conforming objects to the map as
                        annotations using
                        -[MGLMapView addAnnotations:]
                        and related methods, doing so
                        has trade-offs:
- 
                          
Features added as annotations will not have
identifierorattributesproperties when used with feature querying. - 
                          
Features added as annotations become interactive. Taps and selection can be handled in
-[MGLMapViewDelegate mapView:didSelectAnnotation:]. 
- 
                            
                            
An object that uniquely identifies the feature in its containing content source.
You can configure an
MGLVectorStyleLayerobject to include or exclude a specific feature in anMGLShapeSourceorMGLVectorTileSource. In theMGLVectorStyleLayer.predicateproperty, compare the special$idattribute to the feature’s identifier.In vector tiles loaded by
MGLVectorTileSourceobjects, the identifier corresponds to the feature identifier (id). If the source does not specify the feature’s identifier, the value of this property isnil. If specified, the identifier may be an integer, floating-point number, or string. These data types are mapped to instances of the following Foundation classes:In the tile source This property Integer NSNumber(use theunsignedLongLongValueorlongLongValueproperty)Floating-point number NSNumber(use thedoubleValueproperty)String NSStringFor details about the identifiers used in most Mapbox-provided styles, consult the Mapbox Streets layer reference.
The identifier should be set before adding the feature to an
MGLShapeSourceobject; setting it afterwards has no effect on the map’s contents. While it is possible to change this value on feature instances obtained from-[MGLMapView visibleFeaturesAtPoint:]and related methods, doing so likewise has no effect on the map’s contents.Declaration
Objective-C
@property (nonatomic, copy, nullable) id identifier;Swift
var identifier: Any? { get set } - 
                            
                            
A dictionary of attributes for this feature.
You can configure an
MGLVectorStyleLayerobject to include or exclude a specific feature in anMGLShapeSourceorMGLVectorTileSource. In theMGLVectorStyleLayer.predicateproperty, compare a key of the attribute dictionary to the value you want to include. For example, if you want anMGLLineStyleLayerobject to display only important features, you might assign a value above 50 to the important features’importanceattribute, then setMGLVectorStyleLayer.predicateto anNSPredicatewith the formatimportance > 50.You can also configure many layout and paint attributes of an
MGLStyleLayerobject to match the value of an attribute in this dictionary whenever it renders this feature. For example, if you display features in anMGLShapeSourceusing anMGLCircleStyleLayer, you can assign ahalfwayattribute to each of the source’s features, then setMGLCircleStyleLayer.circleRadiusto an expression for the key pathhalfway.The
MGLSymbolStyleLayer.textandMGLSymbolStyleLayer.iconImageNameproperties allow you to use attributes yet another way. For example, to label features in anMGLShapeSourceobject by their names, you can assign anameattribute to each of the source’s features, then setMGLSymbolStyleLayer.textto an expression for the constant string value{name}. See the Predicates and Expressions guide for more information about expressions.In vector tiles loaded by
MGLVectorTileSourceobjects, the keys and values of each feature’s attribute dictionary are determined by the source. Each attribute name is a string, while each attribute value may be a null value, Boolean value, integer, floating-point number, or string. These data types are mapped to instances of the following Foundation classes:In the tile source In this dictionary Null NSNullBoolean NSNumber(use theboolValueproperty)Integer NSNumber(use theunsignedLongLongValueorlongLongValueproperty)Floating-point number NSNumber(use thedoubleValueproperty)String NSStringFor details about the attribute names and values found in Mapbox-provided vector tile sources, consult the Mapbox Streets and Mapbox Terrain layer references.
When adding a feature to an
MGLShapeSource, use the same Foundation types listed above for each attribute value. In addition to the Foundation types, you may also set an attribute to anNSColor(macOS) orUIColor(iOS), which will be converted into its CSS string representation when the feature is added to anMGLShapeSource. This can be convenient when using the attribute to supply a value for a color-typed layout or paint attribute via a key path expression.Note that while it is possible to change this value on feature instances obtained from
-[MGLMapView visibleFeaturesAtPoint:]and related methods, there will be no effect on the map. Setting this value can be useful when the feature instance is used to initialize anMGLShapeSourceand that source is added to the map and styled.Declaration
Objective-C
@property (nonatomic, copy) NSDictionary<NSString *, id> *_Nonnull attributes;Swift
var attributes: [String : Any] { get set } - 
                            
                            
Returns the feature attribute for the given attribute name.
See the
attributesproperty’s documentation for details on keys and values associated with this method.Declaration
Objective-C
- (nullable id)attributeForKey:(nonnull NSString *)key;Swift
func attribute(forKey key: String) -> Any? - 
                            
                            
Returns a dictionary that can be serialized as a GeoJSON Feature representation of an instance of an
MGLFeaturesubclass.The dictionary includes a
geometrykey corresponding to the receiver’s underlying geometry data, apropertieskey corresponding to the receiver’sattributesproperty, and anidkey corresponding to the receiver’sidentifierproperty.Declaration
Objective-C
- (nonnull NSDictionary<NSString *, id> *)geoJSONDictionary;Swift
func geoJSONDictionary() -> [String : Any] 
MGLPointFeature
- 
                            
MGLFeature
The
MGLFeatureprotocol is used to provide details about geographic features contained in anMGLShapeSourceorMGLVectorTileSourceobject. Each concrete subclass ofMGLShapein turn has a subclass that conforms to this protocol. A feature object associates a shape with an optional identifier and attributes.You can add custom data to display on the map by creating feature objects and adding them to an
MGLShapeSourceusing the-[MGLShapeSource initWithIdentifier:shape:options:]method orMGLShapeSource.shapeproperty.In addition to adding data to the map, you can also extract data from the map:
-[MGLMapView visibleFeaturesAtPoint:]and related methods return feature objects that correspond to features in the source. This enables you to inspect the properties of features in vector tiles loaded byMGLVectorTileSourceobjects. You also reuse these feature objects as overlay annotations.While it is possible to add
MGLFeature-conforming objects to the map as annotations using-[MGLMapView addAnnotations:]and related methods, doing so has trade-offs:- 
                                      
Features added as annotations will not have
identifierorattributesproperties when used with feature querying. - 
                                      
Features added as annotations become interactive. Taps and selection can be handled in
-[MGLMapViewDelegate mapView:didSelectAnnotation:]. 
Declaration
Objective-C
@protocol MGLFeature <MGLAnnotation>Swift
protocol MGLFeature : MGLAnnotation - 
                                      
 - 
                            
MGLPointFeature
An
MGLPointFeatureobject associates a point shape with an optional identifier and attributes.Related examples
See the Dynamically style interactive points example to learn how to initialize
MGLPointFeatureobjects and add them to your map.Declaration
Objective-C
@interface MGLPointFeature : MGLPointAnnotation <MGLFeature>Swift
class MGLPointFeature : MGLPointAnnotation, MGLFeature - 
                            
MGLPointFeatureCluster
An
MGLPointFeatureClusterobject associates a point shape (with an optional identifier and attributes) and represents a point cluster.See
MGLClusterRelated examples
See the Clustering point data example to learn how to initialize clusters and add them to your map.
Declaration
Objective-C
@interface MGLPointFeatureCluster : MGLPointFeature <MGLCluster>Swift
class MGLPointFeatureCluster : MGLPointFeature, MGLCluster - 
                            
MGLPolygonFeature
An
MGLPolygonFeatureobject associates a polygon shape with an optional identifier and attributes.Declaration
Objective-C
@interface MGLPolygonFeature : MGLPolygon <MGLFeature>Swift
class MGLPolygonFeature : MGLPolygon, MGLFeature - 
                            
MGLPolylineFeature
An
MGLPolylineFeatureobject associates a polyline shape with an optional identifier and attributes.A polyline feature is known as a LineString feature in GeoJSON.
Related examples
See the Add a line annotation from GeoJSON example to learn how to initialize an
MGLPolylineFeatureand add it to anMGLMapViewobject.Declaration
Objective-C
@interface MGLPolylineFeature : MGLPolyline <MGLFeature>Swift
class MGLPolylineFeature : MGLPolyline, MGLFeature - 
                            
MGLMultiPolygonFeature
An
MGLMultiPolygonFeatureobject associates a multipolygon shape with an optional identifier and attributes.Declaration
Objective-C
@interface MGLMultiPolygonFeature : MGLMultiPolygon <MGLFeature>Swift
class MGLMultiPolygonFeature : MGLMultiPolygon, MGLFeature - 
                            
MGLMultiPolylineFeature
An
MGLMultiPolylineFeatureobject associates a multipolyline shape with an optional identifier and attributes.A multipolyline feature is known as a MultiLineString feature in GeoJSON.
Declaration
Objective-C
@interface MGLMultiPolylineFeature : MGLMultiPolyline <MGLFeature>Swift
class MGLMultiPolylineFeature : MGLMultiPolyline, MGLFeature - 
                            
MGLPointCollectionFeature
An
MGLPointCollectionFeatureobject associates a point collection with an optional identifier and attributes.A point collection feature is known as a MultiPoint feature in GeoJSON.
Declaration
Objective-C
@interface MGLPointCollectionFeature : MGLPointCollection <MGLFeature>Swift
class MGLPointCollectionFeature : MGLPointCollection, MGLFeature - 
                            
MGLShapeCollectionFeature
An
MGLShapeCollectionFeatureobject associates a shape collection with an optional identifier and attributes.MGLShapeCollectionFeatureis most commonly used to add multiple shapes to a singleMGLShapeSource. Configure the appearance of anMGLSource’s shape collection collectively using anMGLSymbolStyleLayerobject, or use multiple instances ofMGLCircleStyleLayer,MGLFillStyleLayer, andMGLLineStyleLayerto configure the appearance of each kind of shape inside the collection.A shape collection feature is known as a feature collection in GeoJSON.
Related examples
See the Add multiple shapes from a single shape source example to learn how to add shape data to your map using an
MGLShapeCollectionFeatureobject.Declaration
Objective-C
@interface MGLShapeCollectionFeature : MGLShapeCollection <MGLFeature>Swift
class MGLShapeCollectionFeature : MGLShapeCollection, MGLFeature - 
                            
MGLEmptyFeature
An
MGLEmptyFeatureobject associates an empty shape with an optional identifier and attributes.Declaration
Objective-C
@interface MGLEmptyFeature : MGLShape <MGLFeature>Swift
class MGLEmptyFeature : MGLShape, MGLFeature 
MGLPointFeatureCluster
- 
                            
MGLFeature
The
MGLFeatureprotocol is used to provide details about geographic features contained in anMGLShapeSourceorMGLVectorTileSourceobject. Each concrete subclass ofMGLShapein turn has a subclass that conforms to this protocol. A feature object associates a shape with an optional identifier and attributes.You can add custom data to display on the map by creating feature objects and adding them to an
MGLShapeSourceusing the-[MGLShapeSource initWithIdentifier:shape:options:]method orMGLShapeSource.shapeproperty.In addition to adding data to the map, you can also extract data from the map:
-[MGLMapView visibleFeaturesAtPoint:]and related methods return feature objects that correspond to features in the source. This enables you to inspect the properties of features in vector tiles loaded byMGLVectorTileSourceobjects. You also reuse these feature objects as overlay annotations.While it is possible to add
MGLFeature-conforming objects to the map as annotations using-[MGLMapView addAnnotations:]and related methods, doing so has trade-offs:- 
                                      
Features added as annotations will not have
identifierorattributesproperties when used with feature querying. - 
                                      
Features added as annotations become interactive. Taps and selection can be handled in
-[MGLMapViewDelegate mapView:didSelectAnnotation:]. 
Declaration
Objective-C
@protocol MGLFeature <MGLAnnotation>Swift
protocol MGLFeature : MGLAnnotation - 
                                      
 - 
                            
MGLPointFeature
An
MGLPointFeatureobject associates a point shape with an optional identifier and attributes.Related examples
See the Dynamically style interactive points example to learn how to initialize
MGLPointFeatureobjects and add them to your map.Declaration
Objective-C
@interface MGLPointFeature : MGLPointAnnotation <MGLFeature>Swift
class MGLPointFeature : MGLPointAnnotation, MGLFeature - 
                            
MGLPointFeatureCluster
An
MGLPointFeatureClusterobject associates a point shape (with an optional identifier and attributes) and represents a point cluster.See
MGLClusterRelated examples
See the Clustering point data example to learn how to initialize clusters and add them to your map.
Declaration
Objective-C
@interface MGLPointFeatureCluster : MGLPointFeature <MGLCluster>Swift
class MGLPointFeatureCluster : MGLPointFeature, MGLCluster - 
                            
MGLPolygonFeature
An
MGLPolygonFeatureobject associates a polygon shape with an optional identifier and attributes.Declaration
Objective-C
@interface MGLPolygonFeature : MGLPolygon <MGLFeature>Swift
class MGLPolygonFeature : MGLPolygon, MGLFeature - 
                            
MGLPolylineFeature
An
MGLPolylineFeatureobject associates a polyline shape with an optional identifier and attributes.A polyline feature is known as a LineString feature in GeoJSON.
Related examples
See the Add a line annotation from GeoJSON example to learn how to initialize an
MGLPolylineFeatureand add it to anMGLMapViewobject.Declaration
Objective-C
@interface MGLPolylineFeature : MGLPolyline <MGLFeature>Swift
class MGLPolylineFeature : MGLPolyline, MGLFeature - 
                            
MGLMultiPolygonFeature
An
MGLMultiPolygonFeatureobject associates a multipolygon shape with an optional identifier and attributes.Declaration
Objective-C
@interface MGLMultiPolygonFeature : MGLMultiPolygon <MGLFeature>Swift
class MGLMultiPolygonFeature : MGLMultiPolygon, MGLFeature - 
                            
MGLMultiPolylineFeature
An
MGLMultiPolylineFeatureobject associates a multipolyline shape with an optional identifier and attributes.A multipolyline feature is known as a MultiLineString feature in GeoJSON.
Declaration
Objective-C
@interface MGLMultiPolylineFeature : MGLMultiPolyline <MGLFeature>Swift
class MGLMultiPolylineFeature : MGLMultiPolyline, MGLFeature - 
                            
MGLPointCollectionFeature
An
MGLPointCollectionFeatureobject associates a point collection with an optional identifier and attributes.A point collection feature is known as a MultiPoint feature in GeoJSON.
Declaration
Objective-C
@interface MGLPointCollectionFeature : MGLPointCollection <MGLFeature>Swift
class MGLPointCollectionFeature : MGLPointCollection, MGLFeature - 
                            
MGLShapeCollectionFeature
An
MGLShapeCollectionFeatureobject associates a shape collection with an optional identifier and attributes.MGLShapeCollectionFeatureis most commonly used to add multiple shapes to a singleMGLShapeSource. Configure the appearance of anMGLSource’s shape collection collectively using anMGLSymbolStyleLayerobject, or use multiple instances ofMGLCircleStyleLayer,MGLFillStyleLayer, andMGLLineStyleLayerto configure the appearance of each kind of shape inside the collection.A shape collection feature is known as a feature collection in GeoJSON.
Related examples
See the Add multiple shapes from a single shape source example to learn how to add shape data to your map using an
MGLShapeCollectionFeatureobject.Declaration
Objective-C
@interface MGLShapeCollectionFeature : MGLShapeCollection <MGLFeature>Swift
class MGLShapeCollectionFeature : MGLShapeCollection, MGLFeature - 
                            
MGLEmptyFeature
An
MGLEmptyFeatureobject associates an empty shape with an optional identifier and attributes.Declaration
Objective-C
@interface MGLEmptyFeature : MGLShape <MGLFeature>Swift
class MGLEmptyFeature : MGLShape, MGLFeature 
MGLPolygonFeature
- 
                            
MGLFeature
The
MGLFeatureprotocol is used to provide details about geographic features contained in anMGLShapeSourceorMGLVectorTileSourceobject. Each concrete subclass ofMGLShapein turn has a subclass that conforms to this protocol. A feature object associates a shape with an optional identifier and attributes.You can add custom data to display on the map by creating feature objects and adding them to an
MGLShapeSourceusing the-[MGLShapeSource initWithIdentifier:shape:options:]method orMGLShapeSource.shapeproperty.In addition to adding data to the map, you can also extract data from the map:
-[MGLMapView visibleFeaturesAtPoint:]and related methods return feature objects that correspond to features in the source. This enables you to inspect the properties of features in vector tiles loaded byMGLVectorTileSourceobjects. You also reuse these feature objects as overlay annotations.While it is possible to add
MGLFeature-conforming objects to the map as annotations using-[MGLMapView addAnnotations:]and related methods, doing so has trade-offs:- 
                                      
Features added as annotations will not have
identifierorattributesproperties when used with feature querying. - 
                                      
Features added as annotations become interactive. Taps and selection can be handled in
-[MGLMapViewDelegate mapView:didSelectAnnotation:]. 
Declaration
Objective-C
@protocol MGLFeature <MGLAnnotation>Swift
protocol MGLFeature : MGLAnnotation - 
                                      
 - 
                            
MGLPointFeature
An
MGLPointFeatureobject associates a point shape with an optional identifier and attributes.Related examples
See the Dynamically style interactive points example to learn how to initialize
MGLPointFeatureobjects and add them to your map.Declaration
Objective-C
@interface MGLPointFeature : MGLPointAnnotation <MGLFeature>Swift
class MGLPointFeature : MGLPointAnnotation, MGLFeature - 
                            
MGLPointFeatureCluster
An
MGLPointFeatureClusterobject associates a point shape (with an optional identifier and attributes) and represents a point cluster.See
MGLClusterRelated examples
See the Clustering point data example to learn how to initialize clusters and add them to your map.
Declaration
Objective-C
@interface MGLPointFeatureCluster : MGLPointFeature <MGLCluster>Swift
class MGLPointFeatureCluster : MGLPointFeature, MGLCluster - 
                            
MGLPolygonFeature
An
MGLPolygonFeatureobject associates a polygon shape with an optional identifier and attributes.Declaration
Objective-C
@interface MGLPolygonFeature : MGLPolygon <MGLFeature>Swift
class MGLPolygonFeature : MGLPolygon, MGLFeature - 
                            
MGLPolylineFeature
An
MGLPolylineFeatureobject associates a polyline shape with an optional identifier and attributes.A polyline feature is known as a LineString feature in GeoJSON.
Related examples
See the Add a line annotation from GeoJSON example to learn how to initialize an
MGLPolylineFeatureand add it to anMGLMapViewobject.Declaration
Objective-C
@interface MGLPolylineFeature : MGLPolyline <MGLFeature>Swift
class MGLPolylineFeature : MGLPolyline, MGLFeature - 
                            
MGLMultiPolygonFeature
An
MGLMultiPolygonFeatureobject associates a multipolygon shape with an optional identifier and attributes.Declaration
Objective-C
@interface MGLMultiPolygonFeature : MGLMultiPolygon <MGLFeature>Swift
class MGLMultiPolygonFeature : MGLMultiPolygon, MGLFeature - 
                            
MGLMultiPolylineFeature
An
MGLMultiPolylineFeatureobject associates a multipolyline shape with an optional identifier and attributes.A multipolyline feature is known as a MultiLineString feature in GeoJSON.
Declaration
Objective-C
@interface MGLMultiPolylineFeature : MGLMultiPolyline <MGLFeature>Swift
class MGLMultiPolylineFeature : MGLMultiPolyline, MGLFeature - 
                            
MGLPointCollectionFeature
An
MGLPointCollectionFeatureobject associates a point collection with an optional identifier and attributes.A point collection feature is known as a MultiPoint feature in GeoJSON.
Declaration
Objective-C
@interface MGLPointCollectionFeature : MGLPointCollection <MGLFeature>Swift
class MGLPointCollectionFeature : MGLPointCollection, MGLFeature - 
                            
MGLShapeCollectionFeature
An
MGLShapeCollectionFeatureobject associates a shape collection with an optional identifier and attributes.MGLShapeCollectionFeatureis most commonly used to add multiple shapes to a singleMGLShapeSource. Configure the appearance of anMGLSource’s shape collection collectively using anMGLSymbolStyleLayerobject, or use multiple instances ofMGLCircleStyleLayer,MGLFillStyleLayer, andMGLLineStyleLayerto configure the appearance of each kind of shape inside the collection.A shape collection feature is known as a feature collection in GeoJSON.
Related examples
See the Add multiple shapes from a single shape source example to learn how to add shape data to your map using an
MGLShapeCollectionFeatureobject.Declaration
Objective-C
@interface MGLShapeCollectionFeature : MGLShapeCollection <MGLFeature>Swift
class MGLShapeCollectionFeature : MGLShapeCollection, MGLFeature - 
                            
MGLEmptyFeature
An
MGLEmptyFeatureobject associates an empty shape with an optional identifier and attributes.Declaration
Objective-C
@interface MGLEmptyFeature : MGLShape <MGLFeature>Swift
class MGLEmptyFeature : MGLShape, MGLFeature 
MGLPolylineFeature
- 
                            
MGLFeature
The
MGLFeatureprotocol is used to provide details about geographic features contained in anMGLShapeSourceorMGLVectorTileSourceobject. Each concrete subclass ofMGLShapein turn has a subclass that conforms to this protocol. A feature object associates a shape with an optional identifier and attributes.You can add custom data to display on the map by creating feature objects and adding them to an
MGLShapeSourceusing the-[MGLShapeSource initWithIdentifier:shape:options:]method orMGLShapeSource.shapeproperty.In addition to adding data to the map, you can also extract data from the map:
-[MGLMapView visibleFeaturesAtPoint:]and related methods return feature objects that correspond to features in the source. This enables you to inspect the properties of features in vector tiles loaded byMGLVectorTileSourceobjects. You also reuse these feature objects as overlay annotations.While it is possible to add
MGLFeature-conforming objects to the map as annotations using-[MGLMapView addAnnotations:]and related methods, doing so has trade-offs:- 
                                      
Features added as annotations will not have
identifierorattributesproperties when used with feature querying. - 
                                      
Features added as annotations become interactive. Taps and selection can be handled in
-[MGLMapViewDelegate mapView:didSelectAnnotation:]. 
Declaration
Objective-C
@protocol MGLFeature <MGLAnnotation>Swift
protocol MGLFeature : MGLAnnotation - 
                                      
 - 
                            
MGLPointFeature
An
MGLPointFeatureobject associates a point shape with an optional identifier and attributes.Related examples
See the Dynamically style interactive points example to learn how to initialize
MGLPointFeatureobjects and add them to your map.Declaration
Objective-C
@interface MGLPointFeature : MGLPointAnnotation <MGLFeature>Swift
class MGLPointFeature : MGLPointAnnotation, MGLFeature - 
                            
MGLPointFeatureCluster
An
MGLPointFeatureClusterobject associates a point shape (with an optional identifier and attributes) and represents a point cluster.See
MGLClusterRelated examples
See the Clustering point data example to learn how to initialize clusters and add them to your map.
Declaration
Objective-C
@interface MGLPointFeatureCluster : MGLPointFeature <MGLCluster>Swift
class MGLPointFeatureCluster : MGLPointFeature, MGLCluster - 
                            
MGLPolygonFeature
An
MGLPolygonFeatureobject associates a polygon shape with an optional identifier and attributes.Declaration
Objective-C
@interface MGLPolygonFeature : MGLPolygon <MGLFeature>Swift
class MGLPolygonFeature : MGLPolygon, MGLFeature - 
                            
MGLPolylineFeature
An
MGLPolylineFeatureobject associates a polyline shape with an optional identifier and attributes.A polyline feature is known as a LineString feature in GeoJSON.
Related examples
See the Add a line annotation from GeoJSON example to learn how to initialize an
MGLPolylineFeatureand add it to anMGLMapViewobject.Declaration
Objective-C
@interface MGLPolylineFeature : MGLPolyline <MGLFeature>Swift
class MGLPolylineFeature : MGLPolyline, MGLFeature - 
                            
MGLMultiPolygonFeature
An
MGLMultiPolygonFeatureobject associates a multipolygon shape with an optional identifier and attributes.Declaration
Objective-C
@interface MGLMultiPolygonFeature : MGLMultiPolygon <MGLFeature>Swift
class MGLMultiPolygonFeature : MGLMultiPolygon, MGLFeature - 
                            
MGLMultiPolylineFeature
An
MGLMultiPolylineFeatureobject associates a multipolyline shape with an optional identifier and attributes.A multipolyline feature is known as a MultiLineString feature in GeoJSON.
Declaration
Objective-C
@interface MGLMultiPolylineFeature : MGLMultiPolyline <MGLFeature>Swift
class MGLMultiPolylineFeature : MGLMultiPolyline, MGLFeature - 
                            
MGLPointCollectionFeature
An
MGLPointCollectionFeatureobject associates a point collection with an optional identifier and attributes.A point collection feature is known as a MultiPoint feature in GeoJSON.
Declaration
Objective-C
@interface MGLPointCollectionFeature : MGLPointCollection <MGLFeature>Swift
class MGLPointCollectionFeature : MGLPointCollection, MGLFeature - 
                            
MGLShapeCollectionFeature
An
MGLShapeCollectionFeatureobject associates a shape collection with an optional identifier and attributes.MGLShapeCollectionFeatureis most commonly used to add multiple shapes to a singleMGLShapeSource. Configure the appearance of anMGLSource’s shape collection collectively using anMGLSymbolStyleLayerobject, or use multiple instances ofMGLCircleStyleLayer,MGLFillStyleLayer, andMGLLineStyleLayerto configure the appearance of each kind of shape inside the collection.A shape collection feature is known as a feature collection in GeoJSON.
Related examples
See the Add multiple shapes from a single shape source example to learn how to add shape data to your map using an
MGLShapeCollectionFeatureobject.Declaration
Objective-C
@interface MGLShapeCollectionFeature : MGLShapeCollection <MGLFeature>Swift
class MGLShapeCollectionFeature : MGLShapeCollection, MGLFeature - 
                            
MGLEmptyFeature
An
MGLEmptyFeatureobject associates an empty shape with an optional identifier and attributes.Declaration
Objective-C
@interface MGLEmptyFeature : MGLShape <MGLFeature>Swift
class MGLEmptyFeature : MGLShape, MGLFeature 
MGLMultiPolygonFeature
- 
                            
MGLFeature
The
MGLFeatureprotocol is used to provide details about geographic features contained in anMGLShapeSourceorMGLVectorTileSourceobject. Each concrete subclass ofMGLShapein turn has a subclass that conforms to this protocol. A feature object associates a shape with an optional identifier and attributes.You can add custom data to display on the map by creating feature objects and adding them to an
MGLShapeSourceusing the-[MGLShapeSource initWithIdentifier:shape:options:]method orMGLShapeSource.shapeproperty.In addition to adding data to the map, you can also extract data from the map:
-[MGLMapView visibleFeaturesAtPoint:]and related methods return feature objects that correspond to features in the source. This enables you to inspect the properties of features in vector tiles loaded byMGLVectorTileSourceobjects. You also reuse these feature objects as overlay annotations.While it is possible to add
MGLFeature-conforming objects to the map as annotations using-[MGLMapView addAnnotations:]and related methods, doing so has trade-offs:- 
                                      
Features added as annotations will not have
identifierorattributesproperties when used with feature querying. - 
                                      
Features added as annotations become interactive. Taps and selection can be handled in
-[MGLMapViewDelegate mapView:didSelectAnnotation:]. 
Declaration
Objective-C
@protocol MGLFeature <MGLAnnotation>Swift
protocol MGLFeature : MGLAnnotation - 
                                      
 - 
                            
MGLPointFeature
An
MGLPointFeatureobject associates a point shape with an optional identifier and attributes.Related examples
See the Dynamically style interactive points example to learn how to initialize
MGLPointFeatureobjects and add them to your map.Declaration
Objective-C
@interface MGLPointFeature : MGLPointAnnotation <MGLFeature>Swift
class MGLPointFeature : MGLPointAnnotation, MGLFeature - 
                            
MGLPointFeatureCluster
An
MGLPointFeatureClusterobject associates a point shape (with an optional identifier and attributes) and represents a point cluster.See
MGLClusterRelated examples
See the Clustering point data example to learn how to initialize clusters and add them to your map.
Declaration
Objective-C
@interface MGLPointFeatureCluster : MGLPointFeature <MGLCluster>Swift
class MGLPointFeatureCluster : MGLPointFeature, MGLCluster - 
                            
MGLPolygonFeature
An
MGLPolygonFeatureobject associates a polygon shape with an optional identifier and attributes.Declaration
Objective-C
@interface MGLPolygonFeature : MGLPolygon <MGLFeature>Swift
class MGLPolygonFeature : MGLPolygon, MGLFeature - 
                            
MGLPolylineFeature
An
MGLPolylineFeatureobject associates a polyline shape with an optional identifier and attributes.A polyline feature is known as a LineString feature in GeoJSON.
Related examples
See the Add a line annotation from GeoJSON example to learn how to initialize an
MGLPolylineFeatureand add it to anMGLMapViewobject.Declaration
Objective-C
@interface MGLPolylineFeature : MGLPolyline <MGLFeature>Swift
class MGLPolylineFeature : MGLPolyline, MGLFeature - 
                            
MGLMultiPolygonFeature
An
MGLMultiPolygonFeatureobject associates a multipolygon shape with an optional identifier and attributes.Declaration
Objective-C
@interface MGLMultiPolygonFeature : MGLMultiPolygon <MGLFeature>Swift
class MGLMultiPolygonFeature : MGLMultiPolygon, MGLFeature - 
                            
MGLMultiPolylineFeature
An
MGLMultiPolylineFeatureobject associates a multipolyline shape with an optional identifier and attributes.A multipolyline feature is known as a MultiLineString feature in GeoJSON.
Declaration
Objective-C
@interface MGLMultiPolylineFeature : MGLMultiPolyline <MGLFeature>Swift
class MGLMultiPolylineFeature : MGLMultiPolyline, MGLFeature - 
                            
MGLPointCollectionFeature
An
MGLPointCollectionFeatureobject associates a point collection with an optional identifier and attributes.A point collection feature is known as a MultiPoint feature in GeoJSON.
Declaration
Objective-C
@interface MGLPointCollectionFeature : MGLPointCollection <MGLFeature>Swift
class MGLPointCollectionFeature : MGLPointCollection, MGLFeature - 
                            
MGLShapeCollectionFeature
An
MGLShapeCollectionFeatureobject associates a shape collection with an optional identifier and attributes.MGLShapeCollectionFeatureis most commonly used to add multiple shapes to a singleMGLShapeSource. Configure the appearance of anMGLSource’s shape collection collectively using anMGLSymbolStyleLayerobject, or use multiple instances ofMGLCircleStyleLayer,MGLFillStyleLayer, andMGLLineStyleLayerto configure the appearance of each kind of shape inside the collection.A shape collection feature is known as a feature collection in GeoJSON.
Related examples
See the Add multiple shapes from a single shape source example to learn how to add shape data to your map using an
MGLShapeCollectionFeatureobject.Declaration
Objective-C
@interface MGLShapeCollectionFeature : MGLShapeCollection <MGLFeature>Swift
class MGLShapeCollectionFeature : MGLShapeCollection, MGLFeature - 
                            
MGLEmptyFeature
An
MGLEmptyFeatureobject associates an empty shape with an optional identifier and attributes.Declaration
Objective-C
@interface MGLEmptyFeature : MGLShape <MGLFeature>Swift
class MGLEmptyFeature : MGLShape, MGLFeature 
MGLMultiPolylineFeature
- 
                            
MGLFeature
The
MGLFeatureprotocol is used to provide details about geographic features contained in anMGLShapeSourceorMGLVectorTileSourceobject. Each concrete subclass ofMGLShapein turn has a subclass that conforms to this protocol. A feature object associates a shape with an optional identifier and attributes.You can add custom data to display on the map by creating feature objects and adding them to an
MGLShapeSourceusing the-[MGLShapeSource initWithIdentifier:shape:options:]method orMGLShapeSource.shapeproperty.In addition to adding data to the map, you can also extract data from the map:
-[MGLMapView visibleFeaturesAtPoint:]and related methods return feature objects that correspond to features in the source. This enables you to inspect the properties of features in vector tiles loaded byMGLVectorTileSourceobjects. You also reuse these feature objects as overlay annotations.While it is possible to add
MGLFeature-conforming objects to the map as annotations using-[MGLMapView addAnnotations:]and related methods, doing so has trade-offs:- 
                                      
Features added as annotations will not have
identifierorattributesproperties when used with feature querying. - 
                                      
Features added as annotations become interactive. Taps and selection can be handled in
-[MGLMapViewDelegate mapView:didSelectAnnotation:]. 
Declaration
Objective-C
@protocol MGLFeature <MGLAnnotation>Swift
protocol MGLFeature : MGLAnnotation - 
                                      
 - 
                            
MGLPointFeature
An
MGLPointFeatureobject associates a point shape with an optional identifier and attributes.Related examples
See the Dynamically style interactive points example to learn how to initialize
MGLPointFeatureobjects and add them to your map.Declaration
Objective-C
@interface MGLPointFeature : MGLPointAnnotation <MGLFeature>Swift
class MGLPointFeature : MGLPointAnnotation, MGLFeature - 
                            
MGLPointFeatureCluster
An
MGLPointFeatureClusterobject associates a point shape (with an optional identifier and attributes) and represents a point cluster.See
MGLClusterRelated examples
See the Clustering point data example to learn how to initialize clusters and add them to your map.
Declaration
Objective-C
@interface MGLPointFeatureCluster : MGLPointFeature <MGLCluster>Swift
class MGLPointFeatureCluster : MGLPointFeature, MGLCluster - 
                            
MGLPolygonFeature
An
MGLPolygonFeatureobject associates a polygon shape with an optional identifier and attributes.Declaration
Objective-C
@interface MGLPolygonFeature : MGLPolygon <MGLFeature>Swift
class MGLPolygonFeature : MGLPolygon, MGLFeature - 
                            
MGLPolylineFeature
An
MGLPolylineFeatureobject associates a polyline shape with an optional identifier and attributes.A polyline feature is known as a LineString feature in GeoJSON.
Related examples
See the Add a line annotation from GeoJSON example to learn how to initialize an
MGLPolylineFeatureand add it to anMGLMapViewobject.Declaration
Objective-C
@interface MGLPolylineFeature : MGLPolyline <MGLFeature>Swift
class MGLPolylineFeature : MGLPolyline, MGLFeature - 
                            
MGLMultiPolygonFeature
An
MGLMultiPolygonFeatureobject associates a multipolygon shape with an optional identifier and attributes.Declaration
Objective-C
@interface MGLMultiPolygonFeature : MGLMultiPolygon <MGLFeature>Swift
class MGLMultiPolygonFeature : MGLMultiPolygon, MGLFeature - 
                            
MGLMultiPolylineFeature
An
MGLMultiPolylineFeatureobject associates a multipolyline shape with an optional identifier and attributes.A multipolyline feature is known as a MultiLineString feature in GeoJSON.
Declaration
Objective-C
@interface MGLMultiPolylineFeature : MGLMultiPolyline <MGLFeature>Swift
class MGLMultiPolylineFeature : MGLMultiPolyline, MGLFeature - 
                            
MGLPointCollectionFeature
An
MGLPointCollectionFeatureobject associates a point collection with an optional identifier and attributes.A point collection feature is known as a MultiPoint feature in GeoJSON.
Declaration
Objective-C
@interface MGLPointCollectionFeature : MGLPointCollection <MGLFeature>Swift
class MGLPointCollectionFeature : MGLPointCollection, MGLFeature - 
                            
MGLShapeCollectionFeature
An
MGLShapeCollectionFeatureobject associates a shape collection with an optional identifier and attributes.MGLShapeCollectionFeatureis most commonly used to add multiple shapes to a singleMGLShapeSource. Configure the appearance of anMGLSource’s shape collection collectively using anMGLSymbolStyleLayerobject, or use multiple instances ofMGLCircleStyleLayer,MGLFillStyleLayer, andMGLLineStyleLayerto configure the appearance of each kind of shape inside the collection.A shape collection feature is known as a feature collection in GeoJSON.
Related examples
See the Add multiple shapes from a single shape source example to learn how to add shape data to your map using an
MGLShapeCollectionFeatureobject.Declaration
Objective-C
@interface MGLShapeCollectionFeature : MGLShapeCollection <MGLFeature>Swift
class MGLShapeCollectionFeature : MGLShapeCollection, MGLFeature - 
                            
MGLEmptyFeature
An
MGLEmptyFeatureobject associates an empty shape with an optional identifier and attributes.Declaration
Objective-C
@interface MGLEmptyFeature : MGLShape <MGLFeature>Swift
class MGLEmptyFeature : MGLShape, MGLFeature 
MGLPointCollectionFeature
- 
                            
MGLFeature
The
MGLFeatureprotocol is used to provide details about geographic features contained in anMGLShapeSourceorMGLVectorTileSourceobject. Each concrete subclass ofMGLShapein turn has a subclass that conforms to this protocol. A feature object associates a shape with an optional identifier and attributes.You can add custom data to display on the map by creating feature objects and adding them to an
MGLShapeSourceusing the-[MGLShapeSource initWithIdentifier:shape:options:]method orMGLShapeSource.shapeproperty.In addition to adding data to the map, you can also extract data from the map:
-[MGLMapView visibleFeaturesAtPoint:]and related methods return feature objects that correspond to features in the source. This enables you to inspect the properties of features in vector tiles loaded byMGLVectorTileSourceobjects. You also reuse these feature objects as overlay annotations.While it is possible to add
MGLFeature-conforming objects to the map as annotations using-[MGLMapView addAnnotations:]and related methods, doing so has trade-offs:- 
                                      
Features added as annotations will not have
identifierorattributesproperties when used with feature querying. - 
                                      
Features added as annotations become interactive. Taps and selection can be handled in
-[MGLMapViewDelegate mapView:didSelectAnnotation:]. 
Declaration
Objective-C
@protocol MGLFeature <MGLAnnotation>Swift
protocol MGLFeature : MGLAnnotation - 
                                      
 - 
                            
MGLPointFeature
An
MGLPointFeatureobject associates a point shape with an optional identifier and attributes.Related examples
See the Dynamically style interactive points example to learn how to initialize
MGLPointFeatureobjects and add them to your map.Declaration
Objective-C
@interface MGLPointFeature : MGLPointAnnotation <MGLFeature>Swift
class MGLPointFeature : MGLPointAnnotation, MGLFeature - 
                            
MGLPointFeatureCluster
An
MGLPointFeatureClusterobject associates a point shape (with an optional identifier and attributes) and represents a point cluster.See
MGLClusterRelated examples
See the Clustering point data example to learn how to initialize clusters and add them to your map.
Declaration
Objective-C
@interface MGLPointFeatureCluster : MGLPointFeature <MGLCluster>Swift
class MGLPointFeatureCluster : MGLPointFeature, MGLCluster - 
                            
MGLPolygonFeature
An
MGLPolygonFeatureobject associates a polygon shape with an optional identifier and attributes.Declaration
Objective-C
@interface MGLPolygonFeature : MGLPolygon <MGLFeature>Swift
class MGLPolygonFeature : MGLPolygon, MGLFeature - 
                            
MGLPolylineFeature
An
MGLPolylineFeatureobject associates a polyline shape with an optional identifier and attributes.A polyline feature is known as a LineString feature in GeoJSON.
Related examples
See the Add a line annotation from GeoJSON example to learn how to initialize an
MGLPolylineFeatureand add it to anMGLMapViewobject.Declaration
Objective-C
@interface MGLPolylineFeature : MGLPolyline <MGLFeature>Swift
class MGLPolylineFeature : MGLPolyline, MGLFeature - 
                            
MGLMultiPolygonFeature
An
MGLMultiPolygonFeatureobject associates a multipolygon shape with an optional identifier and attributes.Declaration
Objective-C
@interface MGLMultiPolygonFeature : MGLMultiPolygon <MGLFeature>Swift
class MGLMultiPolygonFeature : MGLMultiPolygon, MGLFeature - 
                            
MGLMultiPolylineFeature
An
MGLMultiPolylineFeatureobject associates a multipolyline shape with an optional identifier and attributes.A multipolyline feature is known as a MultiLineString feature in GeoJSON.
Declaration
Objective-C
@interface MGLMultiPolylineFeature : MGLMultiPolyline <MGLFeature>Swift
class MGLMultiPolylineFeature : MGLMultiPolyline, MGLFeature - 
                            
MGLPointCollectionFeature
An
MGLPointCollectionFeatureobject associates a point collection with an optional identifier and attributes.A point collection feature is known as a MultiPoint feature in GeoJSON.
Declaration
Objective-C
@interface MGLPointCollectionFeature : MGLPointCollection <MGLFeature>Swift
class MGLPointCollectionFeature : MGLPointCollection, MGLFeature - 
                            
MGLShapeCollectionFeature
An
MGLShapeCollectionFeatureobject associates a shape collection with an optional identifier and attributes.MGLShapeCollectionFeatureis most commonly used to add multiple shapes to a singleMGLShapeSource. Configure the appearance of anMGLSource’s shape collection collectively using anMGLSymbolStyleLayerobject, or use multiple instances ofMGLCircleStyleLayer,MGLFillStyleLayer, andMGLLineStyleLayerto configure the appearance of each kind of shape inside the collection.A shape collection feature is known as a feature collection in GeoJSON.
Related examples
See the Add multiple shapes from a single shape source example to learn how to add shape data to your map using an
MGLShapeCollectionFeatureobject.Declaration
Objective-C
@interface MGLShapeCollectionFeature : MGLShapeCollection <MGLFeature>Swift
class MGLShapeCollectionFeature : MGLShapeCollection, MGLFeature - 
                            
MGLEmptyFeature
An
MGLEmptyFeatureobject associates an empty shape with an optional identifier and attributes.Declaration
Objective-C
@interface MGLEmptyFeature : MGLShape <MGLFeature>Swift
class MGLEmptyFeature : MGLShape, MGLFeature 
MGLShapeCollectionFeature
- 
                            
MGLFeature
The
MGLFeatureprotocol is used to provide details about geographic features contained in anMGLShapeSourceorMGLVectorTileSourceobject. Each concrete subclass ofMGLShapein turn has a subclass that conforms to this protocol. A feature object associates a shape with an optional identifier and attributes.You can add custom data to display on the map by creating feature objects and adding them to an
MGLShapeSourceusing the-[MGLShapeSource initWithIdentifier:shape:options:]method orMGLShapeSource.shapeproperty.In addition to adding data to the map, you can also extract data from the map:
-[MGLMapView visibleFeaturesAtPoint:]and related methods return feature objects that correspond to features in the source. This enables you to inspect the properties of features in vector tiles loaded byMGLVectorTileSourceobjects. You also reuse these feature objects as overlay annotations.While it is possible to add
MGLFeature-conforming objects to the map as annotations using-[MGLMapView addAnnotations:]and related methods, doing so has trade-offs:- 
                                      
Features added as annotations will not have
identifierorattributesproperties when used with feature querying. - 
                                      
Features added as annotations become interactive. Taps and selection can be handled in
-[MGLMapViewDelegate mapView:didSelectAnnotation:]. 
Declaration
Objective-C
@protocol MGLFeature <MGLAnnotation>Swift
protocol MGLFeature : MGLAnnotation - 
                                      
 - 
                            
MGLPointFeature
An
MGLPointFeatureobject associates a point shape with an optional identifier and attributes.Related examples
See the Dynamically style interactive points example to learn how to initialize
MGLPointFeatureobjects and add them to your map.Declaration
Objective-C
@interface MGLPointFeature : MGLPointAnnotation <MGLFeature>Swift
class MGLPointFeature : MGLPointAnnotation, MGLFeature - 
                            
MGLPointFeatureCluster
An
MGLPointFeatureClusterobject associates a point shape (with an optional identifier and attributes) and represents a point cluster.See
MGLClusterRelated examples
See the Clustering point data example to learn how to initialize clusters and add them to your map.
Declaration
Objective-C
@interface MGLPointFeatureCluster : MGLPointFeature <MGLCluster>Swift
class MGLPointFeatureCluster : MGLPointFeature, MGLCluster - 
                            
MGLPolygonFeature
An
MGLPolygonFeatureobject associates a polygon shape with an optional identifier and attributes.Declaration
Objective-C
@interface MGLPolygonFeature : MGLPolygon <MGLFeature>Swift
class MGLPolygonFeature : MGLPolygon, MGLFeature - 
                            
MGLPolylineFeature
An
MGLPolylineFeatureobject associates a polyline shape with an optional identifier and attributes.A polyline feature is known as a LineString feature in GeoJSON.
Related examples
See the Add a line annotation from GeoJSON example to learn how to initialize an
MGLPolylineFeatureand add it to anMGLMapViewobject.Declaration
Objective-C
@interface MGLPolylineFeature : MGLPolyline <MGLFeature>Swift
class MGLPolylineFeature : MGLPolyline, MGLFeature - 
                            
MGLMultiPolygonFeature
An
MGLMultiPolygonFeatureobject associates a multipolygon shape with an optional identifier and attributes.Declaration
Objective-C
@interface MGLMultiPolygonFeature : MGLMultiPolygon <MGLFeature>Swift
class MGLMultiPolygonFeature : MGLMultiPolygon, MGLFeature - 
                            
MGLMultiPolylineFeature
An
MGLMultiPolylineFeatureobject associates a multipolyline shape with an optional identifier and attributes.A multipolyline feature is known as a MultiLineString feature in GeoJSON.
Declaration
Objective-C
@interface MGLMultiPolylineFeature : MGLMultiPolyline <MGLFeature>Swift
class MGLMultiPolylineFeature : MGLMultiPolyline, MGLFeature - 
                            
MGLPointCollectionFeature
An
MGLPointCollectionFeatureobject associates a point collection with an optional identifier and attributes.A point collection feature is known as a MultiPoint feature in GeoJSON.
Declaration
Objective-C
@interface MGLPointCollectionFeature : MGLPointCollection <MGLFeature>Swift
class MGLPointCollectionFeature : MGLPointCollection, MGLFeature - 
                            
MGLShapeCollectionFeature
An
MGLShapeCollectionFeatureobject associates a shape collection with an optional identifier and attributes.MGLShapeCollectionFeatureis most commonly used to add multiple shapes to a singleMGLShapeSource. Configure the appearance of anMGLSource’s shape collection collectively using anMGLSymbolStyleLayerobject, or use multiple instances ofMGLCircleStyleLayer,MGLFillStyleLayer, andMGLLineStyleLayerto configure the appearance of each kind of shape inside the collection.A shape collection feature is known as a feature collection in GeoJSON.
Related examples
See the Add multiple shapes from a single shape source example to learn how to add shape data to your map using an
MGLShapeCollectionFeatureobject.Declaration
Objective-C
@interface MGLShapeCollectionFeature : MGLShapeCollection <MGLFeature>Swift
class MGLShapeCollectionFeature : MGLShapeCollection, MGLFeature - 
                            
MGLEmptyFeature
An
MGLEmptyFeatureobject associates an empty shape with an optional identifier and attributes.Declaration
Objective-C
@interface MGLEmptyFeature : MGLShape <MGLFeature>Swift
class MGLEmptyFeature : MGLShape, MGLFeature 
MGLEmptyFeature
- 
                            
MGLFeature
The
MGLFeatureprotocol is used to provide details about geographic features contained in anMGLShapeSourceorMGLVectorTileSourceobject. Each concrete subclass ofMGLShapein turn has a subclass that conforms to this protocol. A feature object associates a shape with an optional identifier and attributes.You can add custom data to display on the map by creating feature objects and adding them to an
MGLShapeSourceusing the-[MGLShapeSource initWithIdentifier:shape:options:]method orMGLShapeSource.shapeproperty.In addition to adding data to the map, you can also extract data from the map:
-[MGLMapView visibleFeaturesAtPoint:]and related methods return feature objects that correspond to features in the source. This enables you to inspect the properties of features in vector tiles loaded byMGLVectorTileSourceobjects. You also reuse these feature objects as overlay annotations.While it is possible to add
MGLFeature-conforming objects to the map as annotations using-[MGLMapView addAnnotations:]and related methods, doing so has trade-offs:- 
                                      
Features added as annotations will not have
identifierorattributesproperties when used with feature querying. - 
                                      
Features added as annotations become interactive. Taps and selection can be handled in
-[MGLMapViewDelegate mapView:didSelectAnnotation:]. 
Declaration
Objective-C
@protocol MGLFeature <MGLAnnotation>Swift
protocol MGLFeature : MGLAnnotation - 
                                      
 - 
                            
MGLPointFeature
An
MGLPointFeatureobject associates a point shape with an optional identifier and attributes.Related examples
See the Dynamically style interactive points example to learn how to initialize
MGLPointFeatureobjects and add them to your map.Declaration
Objective-C
@interface MGLPointFeature : MGLPointAnnotation <MGLFeature>Swift
class MGLPointFeature : MGLPointAnnotation, MGLFeature - 
                            
MGLPointFeatureCluster
An
MGLPointFeatureClusterobject associates a point shape (with an optional identifier and attributes) and represents a point cluster.See
MGLClusterRelated examples
See the Clustering point data example to learn how to initialize clusters and add them to your map.
Declaration
Objective-C
@interface MGLPointFeatureCluster : MGLPointFeature <MGLCluster>Swift
class MGLPointFeatureCluster : MGLPointFeature, MGLCluster - 
                            
MGLPolygonFeature
An
MGLPolygonFeatureobject associates a polygon shape with an optional identifier and attributes.Declaration
Objective-C
@interface MGLPolygonFeature : MGLPolygon <MGLFeature>Swift
class MGLPolygonFeature : MGLPolygon, MGLFeature - 
                            
MGLPolylineFeature
An
MGLPolylineFeatureobject associates a polyline shape with an optional identifier and attributes.A polyline feature is known as a LineString feature in GeoJSON.
Related examples
See the Add a line annotation from GeoJSON example to learn how to initialize an
MGLPolylineFeatureand add it to anMGLMapViewobject.Declaration
Objective-C
@interface MGLPolylineFeature : MGLPolyline <MGLFeature>Swift
class MGLPolylineFeature : MGLPolyline, MGLFeature - 
                            
MGLMultiPolygonFeature
An
MGLMultiPolygonFeatureobject associates a multipolygon shape with an optional identifier and attributes.Declaration
Objective-C
@interface MGLMultiPolygonFeature : MGLMultiPolygon <MGLFeature>Swift
class MGLMultiPolygonFeature : MGLMultiPolygon, MGLFeature - 
                            
MGLMultiPolylineFeature
An
MGLMultiPolylineFeatureobject associates a multipolyline shape with an optional identifier and attributes.A multipolyline feature is known as a MultiLineString feature in GeoJSON.
Declaration
Objective-C
@interface MGLMultiPolylineFeature : MGLMultiPolyline <MGLFeature>Swift
class MGLMultiPolylineFeature : MGLMultiPolyline, MGLFeature - 
                            
MGLPointCollectionFeature
An
MGLPointCollectionFeatureobject associates a point collection with an optional identifier and attributes.A point collection feature is known as a MultiPoint feature in GeoJSON.
Declaration
Objective-C
@interface MGLPointCollectionFeature : MGLPointCollection <MGLFeature>Swift
class MGLPointCollectionFeature : MGLPointCollection, MGLFeature - 
                            
MGLShapeCollectionFeature
An
MGLShapeCollectionFeatureobject associates a shape collection with an optional identifier and attributes.MGLShapeCollectionFeatureis most commonly used to add multiple shapes to a singleMGLShapeSource. Configure the appearance of anMGLSource’s shape collection collectively using anMGLSymbolStyleLayerobject, or use multiple instances ofMGLCircleStyleLayer,MGLFillStyleLayer, andMGLLineStyleLayerto configure the appearance of each kind of shape inside the collection.A shape collection feature is known as a feature collection in GeoJSON.
Related examples
See the Add multiple shapes from a single shape source example to learn how to add shape data to your map using an
MGLShapeCollectionFeatureobject.Declaration
Objective-C
@interface MGLShapeCollectionFeature : MGLShapeCollection <MGLFeature>Swift
class MGLShapeCollectionFeature : MGLShapeCollection, MGLFeature - 
                            
MGLEmptyFeature
An
MGLEmptyFeatureobject associates an empty shape with an optional identifier and attributes.Declaration
Objective-C
@interface MGLEmptyFeature : MGLShape <MGLFeature>Swift
class MGLEmptyFeature : MGLShape, MGLFeature